home *** CD-ROM | disk | FTP | other *** search
- Path: news.cern.ch!danpop
- From: danpop@mail.cern.ch (Dan Pop)
- Newsgroups: comp.lang.c,comp.lang.c++
- Subject: Re: sizeof() question >>> :)
- Date: 16 Apr 96 18:22:19 GMT
- Organization: CERN European Lab for Particle Physics
- Message-ID: <danpop.829678939@news.cern.ch>
- References: <1996Apr12.061927@topaz> <31714828.1574068@news.linex.com> <4l0dcr$14t0@darwin.nbnet.nb.ca>
- NNTP-Posting-Host: ues5.cern.ch
- Mime-Version: 1.0
- Content-Type: text/plain; charset=US-ASCII
- Content-Transfer-Encoding: 7bit
- X-Newsreader: NN version 6.5.0 #7 (NOV)
-
- In <4l0dcr$14t0@darwin.nbnet.nb.ca> rwb2@mtt.ca (Rick Bruce) writes:
-
- In <31714828.1574068@news.linex.com>, mfried@linex.com (Marty Fried) writes:
- >Once upon a time (OK, it was 12 Apr 96 06:19:27 +1000),
- >naderr@topaz.cqu.edu.au wrote:
- >
- >>How can I get, with a pointer, the sizeof of an array that is
- >>pointed by the pointer ? (No it's not a tounge twister :)
- >>
- >> while (!done) {
- >> ch = getchar();
- >> if (cp - *ct < sizeof(XXXXXXX)-1) {
- >> *cp++ = ch;
- >> } else {
- >> beep();
- >> }
- >> }
- >
- > If you allocate the space for the array you can call one of the memory
- > routines which return the size of the allocation.
- > Dave Gaudet via Rick Bruce
-
- There is no such "routine" in the C language.
-
- Dan
- --
- Dan Pop
- CERN, CN Division
- Email: danpop@mail.cern.ch
- Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
-